
import com.zzh.elasticSearchDemo.model.JobDetail;
import com.zzh.elasticSearchDemo.originalESConnect.OptionImpl;
import com.zzh.elasticSearchDemo.originalESConnect.impl.OptionServiecImpl;
import org.testng.annotations.Test;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;


import java.io.IOException;

/**
 *@ClassName Demo
 *@date 2021/3/15 20:52
 *@Version 1.0
 *@Description //
 */

public class Demo {

    private OptionImpl option;

    @BeforeTest
    public void beforeTest() {
        option = new OptionServiecImpl();
    }

    @Test
    public void test1() throws IOException {
        JobDetail jobDetail = new JobDetail();
        jobDetail.setId(4);
        jobDetail.setArea("北京666");
        jobDetail.setCmp("清华大学");
        jobDetail.setEdu("本科及以上");
        jobDetail.setExp("五年工作经验");
        jobDetail.setTitle("java架构师");
        jobDetail.setJob_type("全职");
        jobDetail.setPv("3000次浏览");
        jobDetail.setJd("Java架构");
        jobDetail.setSalary("60K/月");
        jobDetail.setAge(30);
        option.add(jobDetail);
    }

    @Test
    public void getTest() throws IOException {
        System.out.println(option.findById(4));
    }

    @AfterTest
    public void afterTest() throws IOException {
        option.close();
    }
}
